import request from '@/utils/request'
const prefix = 'api/'

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  return request({
    url: prefix + '/login/login',
    method: 'post',
    data
  })
}

// 登陆
export function loginByNnameAndPwd(userName, password) {
  const data = {
    userName,
    password
  }
  return request({
    url: prefix + 'login/nameAndPwd',
    method: 'post',
    data
  })
}




export function logout() {
  return request({
    url: prefix + 'login/logOut',
    method: 'post'
  })
}
export function getUserInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}

// 验证码
export function picCode() {
  return request({
    url: prefix + 'login/picCode',
    method: 'post'
  })
}
